#pragma once

class AngelMemoryManager
{
private:
	typedef struct _MemoryBlock
	{
		void* block;
		U32 size;
		_MemoryBlock() {}
		_MemoryBlock(void* _block, U32 _size) : block(_block), size(_size) {}
	} MemoryBlock;

	typedef list<MemoryBlock> Blocks;
	Blocks blocks;

private:
	AngelMemoryManager(void);
	AngelMemoryManager(AngelMemoryManager&);
	~AngelMemoryManager(void);
	AngelMemoryManager& operator=(AngelMemoryManager&);

public:
	static AngelMemoryManager* GetInstance() { static AngelMemoryManager instance; return &instance; }

	void* Allocate(U32 _size);
	void Free(void* _memory, U32 _size);
};

DECLARE_SINGLETON_H(AngelMemoryManager);